class Solution {
public:
    bool check(int a, int b)
    {
        return abs(a - b);
    }
    bool canMakeSquare(vector<vector<char>>& grid)
    {
        int cnt1 = 0;
        int cnt2 = 0;
        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < 2; j++)
                if (grid[i][j] == 'B') cnt1++;
                else cnt2++;
        }
        if (abs(cnt1 - cnt2) >= 2) return true;
        cnt1 = cnt2 = 0;

        for (int i = 0; i < 2; i++)
        {
            for (int j = 1; j < 3; j++)
                if (grid[i][j] == 'B') cnt1++;
                else cnt2++;
        }
        if (abs(cnt1 - cnt2) >= 2) return true;
        cnt1 = cnt2 = 0;

        for (int i = 1; i < 3; i++)
        {
            for (int j = 0; j < 2; j++)
                if (grid[i][j] == 'B') cnt1++;
                else cnt2++;
        }
        if (abs(cnt1 - cnt2) >= 2) return true;
        cnt1 = cnt2 = 0;

        for (int i = 1; i < 3; i++)
        {
            for (int j = 1; j < 3; j++)
                if (grid[i][j] == 'B') cnt1++;
                else cnt2++;
        }
        if (abs(cnt1 - cnt2) >= 2) return true;


        return false;
    }
};